#ifndef NATRIUM_UTIL_BACKGROUNDPROCESSOR_H
#define NATRIUM_UTIL_BACKGROUNDPROCESSOR_H

#include "stdafx.h"
#include "util/concurrent.h"

namespace natrium {
	namespace util {
		class BackgroundProcessor {
		public:
			BackgroundProcessor();
			~BackgroundProcessor();

			void operator()(const std::function<void()>& work);

		private:
			void addWork(const std::function<void()>& work);

			bool mDone;

			std::vector<std::thread> mWorkers;
			ConcurrentQueue<std::function<void()>> mWork;
		};
	}
}

#endif
